<template>
    <el-main>
        <el-row justify="center">
            <el-col :span="20">
                <el-row :gutter="10">
                    <el-col :span="4">
                        <el-affix :offset="81" :z-index="9999">
                            <el-menu :default-active="activeIndex" class="el-menu-vertical-bar" router>
                                <el-menu-item index="/user/profile">
                                    <span>个人信息</span>
                                </el-menu-item>
                                <el-menu-item index="/user/account">
                                    <span>账号设置</span>
                                </el-menu-item>
                                <el-menu-item index="">
                                    <span>待完善</span>
                                </el-menu-item>
                                <el-menu-item index="">
                                    <span>待完善</span>
                                </el-menu-item>
                                <el-menu-item index="">
                                    <span>待完善</span>
                                </el-menu-item>
                                <el-menu-item index="">
                                    <span>待完善</span>
                                </el-menu-item>
                                <el-divider />
                                <el-menu-item index="">
                                    <span>待完善</span>
                                    <el-icon class="menu-item-icon">
                                        <ArrowRight />
                                    </el-icon>
                                </el-menu-item>
                                <el-menu-item index="">
                                    <span>待完善</span>
                                    <el-icon class="menu-item-icon">
                                        <ArrowRight />
                                    </el-icon>
                                </el-menu-item>
                            </el-menu>
                        </el-affix>
                    </el-col>
                    <el-col :span="20">
                        <router-view></router-view>
                    </el-col>
                </el-row>
            </el-col>
        </el-row>
    </el-main>
</template>

<script setup>
import { ArrowRight } from '@element-plus/icons-vue'
import { computed } from 'vue'
import { useRoute } from "vue-router"

const route = useRoute()
const activeIndex = computed(() => {
    return route.fullPath
})
</script>

<style lang="scss" scoped>
.el-menu-item {
    justify-content: center;
}

.el-menu-vertical-bar:not(.el-menu--collapse) {
    // min-height: 100%;
    border-radius: 5px;
}

// .el-menu-item{}
.el-menu-item.is-active {
    border-right: 4px solid #9286D1;
}

.el-divider {
    margin: 10px 0;
}

.menu-item-icon {
    position: absolute;
    right: 10px;
}
</style>